package com.security.service.impl;

import com.security.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.security.pojo.User;
import com.security.service.UserService;

import java.util.List;

/**
 * @USER: ysx
 * @CREATE: 2021/1/24 20:40
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public User login(String username) {
        return userMapper.selectUserByUserName(username);
    }

    @Override
    public List<String> findRolesByUser(User user) {
        return userMapper.selectRolesByUserId(user.getId());
    }

    @Override
    public List<String> findResourcesByUser(User user) {
        return userMapper.selectResourcesByUserId(user.getId());
    }
}
